export default {
    getStorage(key) {
        if (key == 'user') {
            return sessionStorage.getItem(key)
        } else if (sessionStorage.getItem(key) !== undefined) {
            return JSON.parse(sessionStorage.getItem(key))
        }
        return {}
    },
    setStorage(key, value) {
        let valueStr = JSON.stringify(value)
        sessionStorage.setItem(key, valueStr)
    },
    removeStorage(key) {
        sessionStorage.removeItem(key)
    }
}
